#include "TcpSocket.hpp"

int main(int argc, char* argv[]){
  if(argc < 3){
    printf("Cli [ip] [port]\n");
    return 0;
  }
  TcpSocket Cli;
  if(!Cli.CreateSocket()){
    return 0;
  }
  std::string svr_ip = argv[1];
  uint16_t svr_port = atoi(argv[2]);
  if(!Cli.Connect(svr_ip, svr_port)){
    return 0;
  }  
  std::string buf = "我是cli";
  buf += std::to_string(getpid());
  while(1){
    Cli.Send(buf);
    usleep(300000);
  }
  Cli.Close();
  return 0;
}
